IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'spSetup_RetrieveAll')
	BEGIN
		PRINT 'Dropping Procedure spSetup_RetrieveAll'
		DROP  Procedure  spSetup_RetrieveAll
	END

GO

PRINT 'Creating Procedure spSetup_RetrieveAll'
GO

CREATE Procedure spSetup_RetrieveAll
	(
		@SysAdmin1User_ID numeric(9,0) = null, 
		@SysAdmin2User_ID numeric(9,0) = null
	)
AS
    /* 
    ------------------------------------------------------------------------------
    - Change History
    - --------------
    - Date          Description
    ------------------------------------------------------------------------------
    - 2007/11/02	Initial version created
    ------------------------------------------------------------------------------
    */
	
	SET NOCOUNT ON
	
	-- Retrieve the relevant records
	SELECT  *
	FROM	Setup
	
	WHERE	(@SysAdmin1User_ID IS NULL OR Setup.SysAdmin1User_ID = @SysAdmin1User_ID)
	  AND	(@SysAdmin2User_ID IS NULL OR Setup.SysAdmin2User_ID = @SysAdmin2User_ID)

	-- Return to calling method
	RETURN
GO
